/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package InterfaceGrafica;

import trabalho4paradigmas.Controle;

/**
 *
 * @author Luis Henrique
 */
public class JanelaRelatorio extends javax.swing.JFrame {

    /**
     * Creates new form JanelaRelatorio
     */
    private Controle carregaControle;
    public JanelaRelatorio() {
        initComponents();
    }
    
    public JanelaRelatorio(Controle c){
        carregaControle= c;
        initComponents();
        
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        jButtonRelatorioVendaCliente = new javax.swing.JToggleButton();
        jButtonRelatorioVendaProduto = new javax.swing.JToggleButton();
        jButtonRelatorioEstoque = new javax.swing.JToggleButton();
        jButtonRelatorioSaidas = new javax.swing.JToggleButton();
        jRelatorioEntradas = new javax.swing.JToggleButton();
        jButtonVoltar = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jLabel1.setFont(new java.awt.Font("Adobe Hebrew", 0, 24)); // NOI18N
        jLabel1.setText("GERAR RELATÓRIO");

        jButtonRelatorioVendaCliente.setText("Relatório Vendas por Cliente");
        jButtonRelatorioVendaCliente.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonRelatorioVendaClienteActionPerformed(evt);
            }
        });

        jButtonRelatorioVendaProduto.setText("Relatório Vendas por Produtos");
        jButtonRelatorioVendaProduto.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonRelatorioVendaProdutoActionPerformed(evt);
            }
        });

        jButtonRelatorioEstoque.setText("Relatório Estoque");
        jButtonRelatorioEstoque.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonRelatorioEstoqueActionPerformed(evt);
            }
        });

        jButtonRelatorioSaidas.setText("Relátorio de Saídas");
        jButtonRelatorioSaidas.setToolTipText("");
        jButtonRelatorioSaidas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonRelatorioSaidasActionPerformed(evt);
            }
        });

        jRelatorioEntradas.setText("Relatório de Entradas");
        jRelatorioEntradas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jRelatorioEntradasActionPerformed(evt);
            }
        });

        jButtonVoltar.setText("Voltar");
        jButtonVoltar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonVoltarActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(55, 55, 55)
                        .addComponent(jLabel1))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(86, 86, 86)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jButtonVoltar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                .addComponent(jRelatorioEntradas, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jButtonRelatorioVendaProduto, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jButtonRelatorioEstoque, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jButtonRelatorioVendaCliente, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jButtonRelatorioSaidas, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))))
                .addContainerGap(55, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(30, 30, 30)
                .addComponent(jLabel1)
                .addGap(46, 46, 46)
                .addComponent(jButtonRelatorioVendaCliente)
                .addGap(18, 18, 18)
                .addComponent(jButtonRelatorioVendaProduto)
                .addGap(18, 18, 18)
                .addComponent(jButtonRelatorioEstoque)
                .addGap(18, 18, 18)
                .addComponent(jButtonRelatorioSaidas)
                .addGap(18, 18, 18)
                .addComponent(jRelatorioEntradas)
                .addGap(18, 18, 18)
                .addComponent(jButtonVoltar)
                .addContainerGap(23, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButtonRelatorioVendaClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonRelatorioVendaClienteActionPerformed
        // TODO add your handling code here:
        JanelaRelatorioCliente jRelatorioCliente = 
                new JanelaRelatorioCliente(carregaControle);
        jRelatorioCliente.setVisible(true);
    }//GEN-LAST:event_jButtonRelatorioVendaClienteActionPerformed

    private void jButtonRelatorioEstoqueActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonRelatorioEstoqueActionPerformed
        // TODO add your handling code here:

        JanelaRelatorioEstoque jEstoque;
        jEstoque = new JanelaRelatorioEstoque(carregaControle.RelatorioEstoque(), carregaControle);
        jEstoque.setVisible(true);
    }//GEN-LAST:event_jButtonRelatorioEstoqueActionPerformed

    private void jButtonRelatorioVendaProdutoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonRelatorioVendaProdutoActionPerformed
        // TODO add your handling code here:
        JanelaRelatorioProdutos jRelatorioProdutos = 
                new JanelaRelatorioProdutos(carregaControle);
        jRelatorioProdutos.setVisible(true);
    }//GEN-LAST:event_jButtonRelatorioVendaProdutoActionPerformed

    private void jButtonRelatorioSaidasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonRelatorioSaidasActionPerformed
        // TODO add your handling code here:
        JanelaRelatorioSaidas jRelatorioSaida = 
                new JanelaRelatorioSaidas
        (carregaControle.RelatorioSaidas(), carregaControle);
        jRelatorioSaida.setVisible(true);
    }//GEN-LAST:event_jButtonRelatorioSaidasActionPerformed

    private void jRelatorioEntradasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRelatorioEntradasActionPerformed
        // TODO add your handling code here:
        JanelaRelatorioEntradas jRelatorioEntradas = 
                new JanelaRelatorioEntradas
        (carregaControle.RelatorioEntradas(), carregaControle);
        jRelatorioEntradas.setVisible(true);
    }//GEN-LAST:event_jRelatorioEntradasActionPerformed

    private void jButtonVoltarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonVoltarActionPerformed
        // TODO add your handling code here:
        this.setVisible(false);
    }//GEN-LAST:event_jButtonVoltarActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(JanelaRelatorio.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(JanelaRelatorio.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(JanelaRelatorio.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(JanelaRelatorio.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new JanelaRelatorio().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JToggleButton jButtonRelatorioEstoque;
    private javax.swing.JToggleButton jButtonRelatorioSaidas;
    private javax.swing.JToggleButton jButtonRelatorioVendaCliente;
    private javax.swing.JToggleButton jButtonRelatorioVendaProduto;
    private javax.swing.JButton jButtonVoltar;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JToggleButton jRelatorioEntradas;
    // End of variables declaration//GEN-END:variables
}
